<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <form action="http://localhost:3000/api/users/login" method="POST">
        <div>
            <input type="text" name="username" placeholder="用户名">
        </div>
        <div>
            <input type="password" name="password" placeholder="密码">
        </div>
        <div>
            <input type="text" name="captcha" placeholder="验证码">
            <img src="http://localhost:3000/api/users/captcha" id="btn" alt="">
        </div>
        <div>
            <button>登录</button>
        </div>
    </form>
    <script>
        var oBtn = document.querySelector("#btn");
        oBtn.onclick = function () {
            this.src = "http://localhost:3000/users/captcha?t" + new Date().getTime()
        }
    </script>
</body>

</html>